VistaDB 6
VistaDB.Provider Namespace / VistaDBConnection Class / GetSchema Method / GetSchema(String,String[]) Method
Specifies the name of the schema to return.Specifies the name of the schema to return.
Specifies a set of restriction values for the requested schema.Values to restrict for this lookup. See MSDN docs for more help on restricting collections.


In This Topic
    GetSchema(String,String[]) Method
    In This Topic
    Returns schema information for the data source of this System.Data.Common.DbConnection using the specified string for the schema name and the specified string array for the restriction values. Returns schema information of the data source of this VistaDBConnection for the specified schema collectionnName and applying an array of optional restriction values. (Example collections: "RESERVEDWORDS", "COLUMNS", "DATATYPES", "VIEWS", "FOREIGNKEYS")
    Syntax
    'Declaration
     
    
    Public Overloads Overrides NotOverridable Function GetSchema( _
       ByVal collectionName As System.String, _
       ByVal restrictionValues() As System.String _
    ) As System.Data.DataTable
    'Usage
     
    
    Dim instance As VistaDBConnection
    Dim collectionName As System.String
    Dim restrictionValues() As System.String
    Dim value As System.Data.DataTable
     
    value = instance.GetSchema(collectionName, restrictionValues)
    public override System.Data.DataTable GetSchema( 
       System.string collectionName,
       System.string[] restrictionValues
    )

    Parameters

    collectionName
    Specifies the name of the schema to return.Specifies the name of the schema to return.
    restrictionValues
    Specifies a set of restriction values for the requested schema.Values to restrict for this lookup. See MSDN docs for more help on restricting collections.

    Return Value

    A System.Data.DataTable that contains schema information.A DataTable that contains schema information.
    Exceptions
    ExceptionDescription
    collectionName is specified as null.
    Remarks
    Examples schema that may be requested are: RESERVEDWORDS - list of words reserved for usage by the engine COLUMNS - List of columns DATATYPES - Types in usage by the current engine VIEWS - Views in the current database FOREIGNKEYS - Lists of foreign keys in database
    Example
    <<code lang="C#">> using (VistaDBConnection cn = new VistaDBConnection("Data Source=|DataDirectory|Database1.vdb6;")) { cn.Open(); DataTable schema = cn.GetSchema("FOREIGNKEYS"); foreach (DataRow dr in schema.Rows) { foreach (DataColumn dc in schema.Columns) { Console.WriteLine(dc.ColumnName + " = " + dr[dc].ToString()); } } } <</code>>
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also